<!-- Page Content -->
<div class="page-content">
    <!-- Page Breadcrumb -->
    <div class="page-breadcrumbs">
        <ul class="breadcrumb">
            <li>
                <a href="/admin">系统</a>
            </li>
            <li>
                <a href="{:url('Cate/lst')}">栏目管理</a>
            </li>
            <li class="active">栏目列表</li>
        </ul>
    </div>
    <!-- /Page Breadcrumb -->

    <!-- Page Body -->
    <div class="page-body">

        <div class="row">
            <div class="col-lg-12 col-sm-12 col-xs-12">
                <div class="widget">
                    <div class="widget-header bordered-bottom bordered-blue">
                        <span class="widget-caption">修改栏目</span>
                    </div>
                    <div class="widget-body">
                        <div id="horizontal-form">
                            <form class="form-horizontal" role="form" action="" method="post"  enctype="multipart/form-data">
                                <input type="hidden" name="id" value="{$cates.id}" />
                                <div class="form-group">
                                    <label class="col-sm-2 control-label no-padding-right">上级栏目</label>
                                    <div class="col-sm-6">
                                        <select name="pid">
                                            <option value="0">顶级栏目</option>
                                            {volist name="cateres" id="cate"}
                                            <option {if condition="$cates['pid'] eq $cate['id']"}selected="selected"{/if} value="{$cate.id}">{if condition="$cate['level'] neq 0"}|{/if}<?php echo str_repeat('-', $cate['level']*4)?>{$cate.catename}</option>
                                            {/volist}
                                        </select>
                                    </div>
                                    <p class="help-block col-sm-4 red">* 必填</p>
                                </div>

                                <div class="form-group">
                                    <label for="catename" class="col-sm-2 control-label no-padding-right">栏目名称</label>
                                    <div class="col-sm-6">
                                        <input class="form-control" id="catename" value="{$cates.catename}" name="catename" required="" type="text">
                                    </div>
                                    <p class="help-block col-sm-4 red">* 必填</p>
                                </div>

                                <div class="form-group">
                                    <label for="keywords" class="col-sm-2 control-label no-padding-right">关键词</label>
                                    <div class="col-sm-6">
                                        <input class="form-control" id="keywords" value="{$cates.keywords}" name="keywords" type="text">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label for="desc" class="col-sm-2 control-label no-padding-right">描述</label>
                                    <div class="col-sm-6">
                                        <textarea id="desc" name="desc" class="form-control">{$cates.desc}</textarea>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label no-padding-right">栏目类型</label>
                                    <div class="col-sm-6">
                                        <div class="radio" style="float:left; margin-right:10px;">
                                            <label>
                                                <input {if condition="$cates['type'] eq 1"}checked="checked"{/if} name="type" value="1"  type="radio">
                                                <span class="text">文章列表</span>
                                            </label>
                                        </div>
                                        <div class="radio" style="float:left; margin-right:10px;">
                                            <label>
                                                <input {if condition="$cates['type'] eq 2"}checked="checked"{/if} name="type" class="inverted" value="2" type="radio">
                                                <span class="text">单页</span>
                                            </label>
                                        </div>
                                        <div class="radio" style="float:left; margin-right:10px;">
                                            <label>
                                                <input {if condition="$cates['type'] eq 3"}checked="checked"{/if} name="type" class="inverted" value="3" type="radio">
                                                <span class="text">图片列表</span>
                                            </label>
                                        </div>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label no-padding-right">推荐到首页</label>
                                    <div class="col-sm-6">
                                        <label  class="radio" style="float:left; margin-right:10px;" style="margin-right:15px;">
                                            <input {if condition="$cates['rec_index'] eq 1"} checked="checked" {/if}  name="rec_index" value="1" type="radio">
                                            <span class="text">是</span>
                                        </label>
                                        <label class="radio" style="float:left; margin-right:10px;" style="margin-right:15px;">
                                            <input {if condition="$cates['rec_index'] eq 0"} checked="checked" {/if}  class="inverted" name="rec_index" value="0" type="radio">
                                            <span class="text">否</span>
                                        </label>
                                    </div>
                                    <p class="help-block col-sm-4 red">* 必填</p>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-2 control-label no-padding-right">推荐到底部</label>
                                    <div class="col-sm-6">
                                        <label class="radio" style="float:left; margin-right:10px;" style="margin-right:15px;">
                                            <input {if condition="$cates['rec_bottom'] eq 1"} checked="checked" {/if} name="rec_bottom" value="1" type="radio">
                                            <span class="text">是</span>
                                        </label>
                                        <label class="radio" style="float:left; margin-right:10px;" style="margin-right:15px;">
                                            <input {if condition="$cates['rec_bottom'] eq 0"} checked="checked" {/if}  class="inverted" name="rec_bottom" value="0" type="radio">
                                            <span class="text">否</span>
                                        </label>
                                    </div>
                                    <p class="help-block col-sm-4 red">* 必填</p>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-2 control-label no-padding-right">缩略图</label>
                                    <div class="col-sm-6">
                                        <input style="float:left;" name="thumb" type="file">
                                        {if condition="$cates['thumb'] neq ''"}
                                        <img style="float:left;" src="{$cates.thumb}" width="30">
                                        {else /}
                                        暂无缩略图
                                        {/if}
                                    </div>
                                    <p class="help-block col-sm-4 red">* 必填</p>
                                </div>

                                <div class="form-group">
                                    <label for="content" class="col-sm-2 control-label no-padding-right">内容</label>
                                    <div class="col-sm-6">
                                        <textarea id="content" name="content">{$cates.content}</textarea>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <div class="col-sm-offset-2 col-sm-10">
                                        <button type="submit" class="btn btn-default">保存信息</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>
    <!-- /Page Body -->
</div>
<!-- /Page Content -->
<script type="text/javascript">
    //实例化编辑器
    //建议使用工厂方法getEditor创建和引用编辑器实例，如果在某个闭包下引用该编辑器，直接调用UE.getEditor('editor')就能拿到相关的实例

    // content对应文章内容的id="content"
    UE.getEditor('content', {initialFrameWidth: '100%', initialFrameHeight: 400,});

</script>